<%@page contentType="text/html" import="arocms.Constans"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>

<html:link action="/Forum/Form" styleClass="button">Drop a line</html:link>
<logic:present name="<%=Constans.FORUM_POST_LIST%>">
    <table>
        <logic:iterate name="<%=Constans.FORUM_POST_LIST%>" id="post">
            <tr>
                <td>
                    ${post.title} 
                    <html:link action="/Forum/Answer" paramName="post" paramProperty="id" paramId="parent_id">Answer</html:link> 
                    <html:link action="/Forum/Delete" paramName="post" paramProperty="id" paramId="id">Delete</html:link>
                </td>
            </tr>
            <tr>
                <td>
                    ${post.text}
                </td>
            </tr>
            <tr>
                <td>
                    ${post.author} ${post.email}
                </td>
            </tr>
        </logic:iterate>
    </table>
</logic:present>